package com.starry.module.system.core.tenant.feign;

import com.starry.core.common.domain.R;
import com.starry.core.web.core.controller.BaseController;
import com.starry.module.system.api.tenant.SysTenantApi;
import com.starry.module.system.api.tenant.domain.vo.SysTenantDtlVo;
import com.starry.module.system.core.tenant.service.SysTenantService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * RPC-系统租户
 *
 * @author xiaoke
 */
@Tag(name = "RPC-系统租户")
@RestController
public class SysTenantApiImpl extends BaseController implements SysTenantApi {

    private final SysTenantService sysTenantService;

    public SysTenantApiImpl(SysTenantService sysTenantService) {
        this.sysTenantService = sysTenantService;
    }

    @Operation(summary = "RPC-系统租户-详情")
    @Override
    @GetMapping(GET_DETAIL)
    public R<SysTenantDtlVo> findById(Long id) {
        return success(sysTenantService.getById(id));
    }
}
